<template>
  <div>
    <header>
      <img class="banner-video" :src="indexVideoImg" alt="连接你我" />
      <div class="inner">
        <h1>不忘初心</h1>
        <p>历经千帆，归来仍是少年</p>
      </div>
    </header>

    <div class="ability">
      <h1 class="common-header">能力展示</h1>
      <p class="common-header-eng">DISPLAY ABILITY</p>
      <div class="category">
        <div class="item" v-for="(item, index) in category" :key="index">
          <img :src="item.src" alt="" class="bg" />
          <a href="/face-detection">
            <div class="content">
              <h4 class="title">人脸检测</h4>
              <p class="desc">
                检测图片中的人脸，返回高精度的人脸坐标。同时支持实时特征抽取和后续的人脸比对、搜索等工作
              </p>
              <div class="btn btn-more">了解更多</div>
            </div></a
          >
        </div>
      </div>
    </div>

    <div class="platformadvantages">
      <div class="description">
        <h1 class="advheader">平台优势</h1>
        <p>PLATFORM ADVANTAGES</p>
      </div>
      <div class="pacategory">
        <div class="item" v-for="(item, index) in pacategory" :key="index">
          <!-- <img :src="item.src" /> -->
          <div class="icon"></div>
          <p class="title">{{ item.title }}</p>
          <p class="desc">{{ item.title }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";
import indexVideoImg from "@/assets/img/home/banner.jpg";
export default {
  setup() {
    const state = reactive({
      slider_index: 0,
      category: [
        {
          title: "人脸识别",
          url: "face-detection",
          src: require("../../assets/img/home/demo1.jpg"),
        },
        {
          title: "图像理解",
          url: "imageunderstd",
          src: require("../../assets/img/home/demo1.jpg"),
        },
        {
          title: "图像生成",
          url: "imagegeneration",
          src: require("../../assets/img/home/demo1.jpg"),
        },
      ],
      pacategory: [
        {
          title: "识别效率高",
          content: "简要功能文案介绍",
          src: require("../../assets/img/home/demo1.jpg"),
        },
        {
          title: "可免费定制",
          content: "简要功能文案介绍",
          src: require("../../assets/img/home/demo1.jpg"),
        },
        {
          title: "一站式文案",
          content: "简要功能文案介绍",
          src: require("../../assets/img/home/demo1.jpg"),
        },
        {
          title: "安全稳定",
          src: require("../../assets/img/home/demo1.jpg"),
        },
      ],
    });

    return {
      ...toRefs(state), // 解构转换为响应式框架
      indexVideoImg,
    };
  },
};
</script>

<style lang='scss'>
header {
  width: 100%;
  height: 810px;
  margin-top: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;

  @media screen and (max-width: 992px) {
    height: 570px;
  }
}
.banner-video {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
  object-fit: fill;

  @media screen and (max-width: 992px) {
    object-fit: cover;
  }
}
.inner {
  // z-index: 2;
  width: 1200px;
  text-align: left;
  position: absolute;
  top: 140px;
  // margin: 100px auto;
  // padding-top: 100px;
  h1 {
    font-size: 42px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 80px;
  }
  p {
    font-size: 26px;
    font-weight: 400;
    color: #ffffff;
    line-height: 34px;
    padding-left: 30px;
  }
}

.ability {
  background: #ffffff;
  padding-bottom: 80px;
  .category {
    margin: 0px auto;
    display: flex;
    width: 1200px;
    justify-content: space-between;
    .item {
      // height: 407px;
      width: 360px;
      margin-right: 60px;
      text-align: center;
      border-radius: 4px;
      -webkit-transition: all 0.3s;
      transition: all 0.3s;
      position: relative;

      .bg {
        width: 100%;
        // height: 178px;
      }
      .content {
        padding: 30px;
        background: #fff;
        height: 234px;
        position: relative;
        .title {
          color: #263858;
          font-size: 20px;
          margin-bottom: 10px;
          font-weight: 600;
          line-height: 1.4;
        }
        .desc {
          font-size: 16px;
          color: #1c2147;
          line-height: 1.5625;
        }
        .btn {
          display: inline-block;
          height: 36px;
          width: 136px;
          line-height: 36px;
          font-size: 14px;
          color: #263858;
          border: 1px solid #263858;
          border-radius: 4px;
          position: absolute;
          bottom: 30px;
          left: 0;
          right: 0;
          margin: auto;
        }
      }
    }
    .item:last-child {
      margin-right: 0;
    }
    .item:hover {
      cursor: pointer;
      -webkit-transform: translateY(-7px);
      transform: translateY(-7px);
      box-shadow: 0 10px 25px 0 rgba(27, 38, 94, 0.05);
      .title {
        color: #6395ff;
      }
      .btn {
        background: #6395ff;
        border-color: #6395ff;
        color: #fff;
      }
    }
  }
}
.platformadvantages {
  // background: #f4f6fc;
  padding: 80px 0;
  background-image: url(https://cdn.faceplusplus.com.cn/mc-official/v2.1/img/advantage-bg.6c1ec80.png);
  background-size: cover;
  background-position: 50%;
  color: #fff;
  text-align: center;
  // padding: 80px 0px;
  .description {
    height: 160px;
    padding-bottom: 80px;

    .advheader {
      font-size: 30px;
      font-weight: 600;
      line-height: 1.4;
      position: relative;
      padding-bottom: 10px;
      text-align: center;
      color: #fff;
    }
    h1 {
      font-size: 30px;

      font-weight: 500;
      color: #333333;
      text-align: center;
      margin-bottom: 10px;
    }
    h1::after {
      background: #fff;
      content: "";
      position: absolute;
      top: 50px;
      left: 0;
      right: 0;
      margin: auto;
      width: 48px;
      height: 2px;
    }
    p {
      font-size: 12px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #999999;
      letter-spacing: 6px;
      text-align: center;
    }
  }
  .pacategory {
    display: flex;
    justify-content: center; /* 水平居中 */
    .item {
      text-align: center;
      width: 280px;
      .icon {
        width: 60px;
        height: 60px;
        margin: auto;
        margin-bottom: 20px;
        background-image: url(https://cdn.faceplusplus.com.cn/mc-official/v2.1/img/advantage-icon.94b9193.png);
        background-size: 300%;
        background-repeat: no-repeat;
        background-position-y: -1px;
      }
    }
    .title {
      font-size: 20px;
      font-weight: 500;
      line-height: 1.4;
      margin-bottom: 15px;
      font-weight: 600px;
    }
    .desc {
      font-size: 16px;
      font-weight: 400;
      line-height: 1.5625;
    }
  }
}
</style>